<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Promise回顾</title>
  </head>
  <body>
    <script>
      new Promise(function (resolve, reject) {
        resolve('成功')
        console.log('promise任务')

        // reject('失败')
      }).then(
        //   异步执行
        (value) => {
          console.log(value)
        },
        (reason) => {
          console.log(reason)
        }
      )
      console.log('同步。。。')
    </script>
  </body>
</html>
